package com.usth.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.usth.model.Airport;
import com.usth.model.FlightCom;
import com.usth.model.FlightInfo;
import com.usth.model.FlightTranVO;
import com.usth.model.TransitPrice;
import com.usth.service.IFlightService;

public class FlightAction extends ActionSupport{
private List<Airport> airportlist;
private List<FlightCom> comlist;
private IFlightService flightservice;
private List<TransitPrice> transitAirport;
private List<FlightInfo> flist;
private String fid;
private List<FlightTranVO> ftplist;
private FlightTranVO tvo;
private String anames;
public String getAnames() {
	return anames;
}
public void setAnames(String anames) {
	this.anames = anames;
}
public FlightTranVO getTvo() {
	return tvo;
}
public void setTvo(FlightTranVO tvo) {
	this.tvo = tvo;
}
public List<FlightTranVO> getFtplist() {
	return ftplist;
}
public void setFtplist(List<FlightTranVO> ftplist) {
	this.ftplist = ftplist;
}
public String getFid() {
	return fid;
}
public void setFid(String fid) {
	this.fid = fid;
}
public List<FlightInfo> getFlist() {
	return flist;
}
public void setFlist(List<FlightInfo> flist) {
	this.flist = flist;
}
private FlightInfo fi;
public FlightInfo getFi() {
	return fi;
}
public void setFi(FlightInfo fi) {
	this.fi = fi;
}
public List<TransitPrice> getTransitAirport() {
	return transitAirport;
}
public void setTransitAirport(List<TransitPrice> transitAirport) {
	this.transitAirport = transitAirport;
}
public List<Airport> getAirportlist() {
	return airportlist;
}
public void setAirportlist(List<Airport> airportlist) {
	this.airportlist = airportlist;
}
public List<FlightCom> getComlist() {
	return comlist;
}
public void setComlist(List<FlightCom> comlist) {
	this.comlist = comlist;
}
public IFlightService getFlightservice() {
	return flightservice;
}
public void setFlightservice(IFlightService flightservice) {
	this.flightservice = flightservice;
}
public String preadd(){
	this.setAirportlist(this.flightservice.listair());
	this.setComlist(this.flightservice.listcom());
	return "preadd";
}
public String addflight(){
	this.flightservice.addflight(fi);
	return "addflight";
}
public String preedit(){
	this.setFlist(this.flightservice.listflights());
	this.setComlist(this.flightservice.listcom());
	this.setAirportlist(this.flightservice.listair());
	return "preedit";
}
public String flightedit(){
	this.flightservice.flightedit(fi);
	return "flightedit";
}
public String delflight(){
	this.flightservice.delflight(fid);
	return "delflight";
}
public String pretran(){
	this.setAirportlist(this.flightservice.listair());
	this.setFlist(this.flightservice.listflights());
	this.setFtplist(this.flightservice.pretran());
	return "pretran";
}
}
